package org.pierre.inputbenchmark.activity;

import org.pierre.inputbenchmark.R;

import android.os.Bundle;
import android.view.MotionEvent;
import android.widget.TextView;

public class TouchBenchmarkActivity extends FrequencyBenchmarkActivity
{
	private TextView resultText;
	
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		
		this.setContentView(R.layout.touch);
		
		this.resultText = (TextView) this.findViewById(R.id.touch_frequency);
	}
	
	public boolean onTouchEvent(MotionEvent event)
	{
		int averageFrequency = this.getAverageFrequency(event.getEventTime());
		
		this.resultText.setText(averageFrequency + " Hz");
		
		return true;
	}
}
